package com.grq.framework.core.exception;

import com.grq.framework.core.result.ResultData;

import javax.servlet.http.HttpServletResponse;

public interface GrqRestExceptionHandler {

    /**
     * 未登录异常
     * 401
     *
     * @return
     */
    ResultData notLoginException(RuntimeException e, HttpServletResponse response);


    /**
     * 无权限异常
     * 403
     *
     * @return
     */
    ResultData notPermissionException(RuntimeException e, HttpServletResponse response);

    /**
     * 无角色异常
     * 403
     *
     * @return
     */
    ResultData notRoleException(RuntimeException e, HttpServletResponse response);

    /**
     * 二级认证失败
     * 412
     *
     * @return
     */
    ResultData notSafeException(RuntimeException e, HttpServletResponse response);

    /**
     * 业务异常
     * 500
     */
    ResultData businessException(BusinessException e, HttpServletResponse response);

    /**
     * 处理通用异常
     * 500
     *
     * @param e
     * @return
     */
    ResultData exception(Exception e, HttpServletResponse response);

}
